

n = int(input("输入一个三位数："))
num = 0
list1 = []
for i in range(100,n):
    a = i % 10
    b = i // 10 % 10
    c = i // 100
    sum = a ** 3 + b ** 3 + c ** 3
    if (i == sum):
        print(i,"是水仙花数")
        num += 1
        list1.append(i)
        continue
    else:
        continue
        print(i,"不是水仙花数")
print(f"共有{num}个水仙花数")
print(list1)
